package com.google.code.nexttraffic.web.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.google.code.nexttraffic.web.model.base.BaseObject;


/**
 * @author ParkHaeCheol
 * 
 */
public class Timetable extends BaseObject {

	private static final long serialVersionUID = 1L;

	private Integer timetableid;
	
	private String distance;
	
	private String timerequied;
	
	private String startTime;
	
	private String buskind;
	
	private String road;
	
	private String buscompany;
	
	private String etc;
	
	private Integer startTerminal;
	
	private Integer arrivalTerminal;

	public Timetable(){}

	public Timetable(Integer timetableid, String distance, String timerequied,
			String startTime, String buskind, String road, String buscompany,
			String etc, Integer startTerminal, Integer arrivalTerminal) {
		super();
		this.timetableid = timetableid;
		this.distance = distance;
		this.timerequied = timerequied;
		this.startTime = startTime;
		this.buskind = buskind;
		this.road = road;
		this.buscompany = buscompany;
		this.etc = etc;
		this.startTerminal = startTerminal;
		this.arrivalTerminal = arrivalTerminal;
	}

	@Override
	public boolean equals(Object o) {

		if (o instanceof Timetable == false) {
			return false;
		}

		if (this == o) {
			return true;
		}

		Timetable rhs = (Timetable) o;

		EqualsBuilder equb = new EqualsBuilder();
		equb.append(timetableid, rhs.getTimetableid());
		equb.append(distance, rhs.getDistance());
		equb.append(timerequied, rhs.getTimerequied());
		equb.append(startTime, rhs.getStartTime());

		return equb.isEquals();
	}

	@Override
	public int hashCode() {

		HashCodeBuilder hashcode = new HashCodeBuilder(3, 37);
		hashcode.append(timetableid);
		hashcode.append(distance);
		hashcode.append(timerequied);
		hashcode.append(startTime);

		return hashcode.toHashCode();
	}

	@Override
	public String toString() {

		ToStringBuilder tob = new ToStringBuilder(this,
				ToStringStyle.MULTI_LINE_STYLE);

		tob.append("timetableid", timetableid);
		tob.append("distance", distance);
		tob.append("timerequied", timerequied);
		tob.append("startTime", startTime);
		tob.append("buskind", buskind);
		tob.append("road", road);
		tob.append("buscompany", buscompany);
		tob.append("etc", etc);
		tob.append("startTerminal", startTerminal);
		tob.append("arrivalTerminal", arrivalTerminal);

		return tob.toString();

	}

	public Integer getTimetableid() {
		return timetableid;
	}

	public void setTimetableid(Integer timetableid) {
		this.timetableid = timetableid;
	}

	public String getDistance() {
		return distance;
	}

	public void setDistance(String distance) {
		this.distance = distance;
	}

	public String getTimerequied() {
		return timerequied;
	}

	public void setTimerequied(String timerequied) {
		this.timerequied = timerequied;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getBuskind() {
		return buskind;
	}

	public void setBuskind(String buskind) {
		this.buskind = buskind;
	}

	public String getRoad() {
		return road;
	}

	public void setRoad(String road) {
		this.road = road;
	}

	public String getBuscompany() {
		return buscompany;
	}

	public void setBuscompany(String buscompany) {
		this.buscompany = buscompany;
	}

	public String getEtc() {
		return etc;
	}

	public void setEtc(String etc) {
		this.etc = etc;
	}

	public Integer getStartTerminal() {
		return startTerminal;
	}

	public void setStartTerminal(Integer startTerminal) {
		this.startTerminal = startTerminal;
	}

	public Integer getArrivalTerminal() {
		return arrivalTerminal;
	}

	public void setArrivalTerminal(Integer arrivalTerminal) {
		this.arrivalTerminal = arrivalTerminal;
	}


}
